﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace MsForgeReboot.Framework.TownCrierChannels {
    public class HttpBasicAuthConfigurationElement : ConfigurationElement {
        private static ConfigurationProperty _username;
        private static ConfigurationProperty _password;
        private static ConfigurationPropertyCollection _collection;

        [ConfigurationProperty("username", IsRequired = true)]
        public string Username {
            get { return (string)base[_username]; }
        }

        [ConfigurationProperty("password", IsRequired = true)]
        public string Password {
            get { return (string)base[_password]; }
        }

        static HttpBasicAuthConfigurationElement() {
            _username = new ConfigurationProperty("username", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
            _password = new ConfigurationProperty("password", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
            _collection = new ConfigurationPropertyCollection { _username, _password };
        }

        protected override ConfigurationPropertyCollection Properties {
            get {
                return _collection;
            }
        }

    }
    
}
